{% load static %}
<!DOCTYPE html>
<html lang="zh-CN">
<head>
    <meta charset="UTF-8">
    <title>{% block title %}Local Library{% endblock %}</title>
    <link rel="stylesheet" href="{% static 'catalog/style.css' %}">
    {% block extra_head %}{% endblock %}
</head>
<body>
    <nav>
        <span class="nav-title">Local Library</span>
        <a href="{% url 'index' %}">首页</a>
        <a href="{% url 'my-borrowed' %}">我的借阅</a>
        <a href="{% url 'authors' %}">作者列表</a>
        <a href="{% url 'all-borrowed' %}">所有借出图书</a>
        <a href="{% url 'author-create' %}">新增作者</a>
        <a href="{% url 'login' %}">登录</a>
        <a href="{% url 'logout' %}">注销</a>
        <a href="{% url 'my-loan-history' %}">借阅历史</a>
        <form action="{% url 'book-search' %}" method="get" style="display:inline-block; margin-left:32px;">
            <input type="text" name="q" placeholder="搜索书名或作者" style="padding:4px 8px; border-radius:4px; border:1px solid #b0bec5;">
            <button type="submit" class="btn" style="padding:4px 12px;">搜索</button>
        </form>
        <span style="margin-left:auto; font-size:0.95rem; color:#fff;">{% if user.is_authenticated %}👤 {{ user.username }}{% endif %}</span>
    </nav>
    <div class="container">
        {% if messages %}
            <ul style="list-style:none;padding:0;">
            {% for message in messages %}
                <li style="background:#e3f2fd;color:#1976d2;padding:8px 16px;margin-bottom:8px;border-radius:6px;box-shadow:0 1px 4px rgba(25,118,210,0.06);font-weight:bold;">{{ message }}</li>
            {% endfor %}
            </ul>
        {% endif %}
        {% block content %}{% endblock %}
    </div>
</body>
</html> 